# Contributor: Alex McGrath <amk@amk.ie>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-typing_inspect
_pkgname=typing_inspect
pkgver=0.9.0
pkgrel=2
pkgdesc="Defines an API for runtime inspection of types defined in the Python standard typing module"
url="https://github.com/ilevkivskyi/typing_inspect"
arch="noarch"
license="MIT"
depends="py3-mypy-extensions py3-typing-extensions"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="typing_inspect-$pkgver.tar.gz::https://github.com/ilevkivskyi/typing_inspect/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest \
		--deselect test_typing_inspect.py::GetUtilityTestCase::test_typed_dict_typing_extension
	# https://github.com/ilevkivskyi/typing_inspect/issues/84
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
106597b100c3abda89cc15e0f0cd1fbcc771cb04e15e1d85da2134b9937d1a9b8d1fb396aa94fc350d8e21eeaa7f96f4c98c08923360f7eb1fb5b7b7d1a32df5  typing_inspect-0.9.0.tar.gz
"
